<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Taskflow Handbook</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="https://taskflow.github.io/">Taskflow</a>
   &#160;<span id="projectnumber">3.0.0-Master-Branch</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classtf_1_1cudaFlowCapturerBase.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classtf_1_1cudaFlowCapturerBase-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">tf::cudaFlowCapturerBase Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>base class to construct a CUDA task graph through stream capture  
 <a href="classtf_1_1cudaFlowCapturerBase.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="cuda__capturer_8hpp_source.html">cuda_capturer.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for tf::cudaFlowCapturerBase:</div>
<div class="dyncontent">
<div class="center"><img src="classtf_1_1cudaFlowCapturerBase__inherit__graph.png" border="0" usemap="#tf_1_1cudaFlowCapturerBase_inherit__map" alt="Inheritance graph"/></div>
<map name="tf_1_1cudaFlowCapturerBase_inherit__map" id="tf_1_1cudaFlowCapturerBase_inherit__map">
<area shape="rect" id="node2" href="classtf_1_1cublasFlowCapturer.html" title="class object to construct a cuBLAS task graph " alt="" coords="5,79,160,104"/>
<area shape="rect" id="node3" href="classtf_1_1cudaFlowCapturer.html" title="class for building a CUDA task dependency graph through stream capture " alt="" coords="183,79,329,104"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a43739b92f51358bd144270664c6fdf8e"><td class="memItemLeft" align="right" valign="top"><a id="a43739b92f51358bd144270664c6fdf8e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a43739b92f51358bd144270664c6fdf8e">cudaFlowCapturerBase</a> ()=default</td></tr>
<tr class="memdesc:a43739b92f51358bd144270664c6fdf8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">default constructor <br /></td></tr>
<tr class="separator:a43739b92f51358bd144270664c6fdf8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09d58616acdfe01dfe09271f8b3587ff"><td class="memItemLeft" align="right" valign="top"><a id="a09d58616acdfe01dfe09271f8b3587ff"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a09d58616acdfe01dfe09271f8b3587ff">~cudaFlowCapturerBase</a> ()=default</td></tr>
<tr class="memdesc:a09d58616acdfe01dfe09271f8b3587ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">default virtual destructor <br /></td></tr>
<tr class="separator:a09d58616acdfe01dfe09271f8b3587ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf651356def71f613c589c29588398c2"><td class="memTemplParams" colspan="2">template&lt;typename C &gt; </td></tr>
<tr class="memitem:adf651356def71f613c589c29588398c2"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#adf651356def71f613c589c29588398c2">on</a> (C &amp;&amp;callable)</td></tr>
<tr class="memdesc:adf651356def71f613c589c29588398c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a sequential CUDA operations from the given callable  <a href="#adf651356def71f613c589c29588398c2">More...</a><br /></td></tr>
<tr class="separator:adf651356def71f613c589c29588398c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38adf66dfcc0829708db653d153a83e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a38adf66dfcc0829708db653d153a83e2">memcpy</a> (void *dst, const void *src, size_t count)</td></tr>
<tr class="memdesc:a38adf66dfcc0829708db653d153a83e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">copies data between host and device asynchronously through a stream  <a href="#a38adf66dfcc0829708db653d153a83e2">More...</a><br /></td></tr>
<tr class="separator:a38adf66dfcc0829708db653d153a83e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fd8983c782f841bba6b10de39becdf6"><td class="memTemplParams" colspan="2">template&lt;typename T , std::enable_if_t&lt;!std::is_same_v&lt; T, void &gt;, void &gt; *  = nullptr&gt; </td></tr>
<tr class="memitem:a9fd8983c782f841bba6b10de39becdf6"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a9fd8983c782f841bba6b10de39becdf6">copy</a> (T *tgt, const T *src, size_t num)</td></tr>
<tr class="memdesc:a9fd8983c782f841bba6b10de39becdf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a copy task of typed data  <a href="#a9fd8983c782f841bba6b10de39becdf6">More...</a><br /></td></tr>
<tr class="separator:a9fd8983c782f841bba6b10de39becdf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e3071171c0875c93dcc077a2e0a435a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a8e3071171c0875c93dcc077a2e0a435a">memset</a> (void *devPtr, int value, size_t count)</td></tr>
<tr class="memdesc:a8e3071171c0875c93dcc077a2e0a435a"><td class="mdescLeft">&#160;</td><td class="mdescRight">initializes or sets GPU memory to the given value byte by byte  <a href="#a8e3071171c0875c93dcc077a2e0a435a">More...</a><br /></td></tr>
<tr class="separator:a8e3071171c0875c93dcc077a2e0a435a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad836d32cc2e9532ce57fe3ad6cc67d5d"><td class="memTemplParams" colspan="2">template&lt;typename F , typename... ArgsT&gt; </td></tr>
<tr class="memitem:ad836d32cc2e9532ce57fe3ad6cc67d5d"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#ad836d32cc2e9532ce57fe3ad6cc67d5d">kernel</a> (dim3 g, dim3 b, size_t s, F &amp;&amp;f, ArgsT &amp;&amp;... args)</td></tr>
<tr class="memdesc:ad836d32cc2e9532ce57fe3ad6cc67d5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a kernel  <a href="#ad836d32cc2e9532ce57fe3ad6cc67d5d">More...</a><br /></td></tr>
<tr class="separator:ad836d32cc2e9532ce57fe3ad6cc67d5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac25236625772a0a2c66831517b9ec288"><td class="memTemplParams" colspan="2">template&lt;typename C &gt; </td></tr>
<tr class="memitem:ac25236625772a0a2c66831517b9ec288"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#ac25236625772a0a2c66831517b9ec288">single_task</a> (C &amp;&amp;callable)</td></tr>
<tr class="memdesc:ac25236625772a0a2c66831517b9ec288"><td class="mdescLeft">&#160;</td><td class="mdescRight">capturers a kernel to runs the given callable with only one thread  <a href="#ac25236625772a0a2c66831517b9ec288">More...</a><br /></td></tr>
<tr class="separator:ac25236625772a0a2c66831517b9ec288"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a583e4df1139cf6f20b6e79dfde977a51"><td class="memTemplParams" colspan="2">template&lt;typename I , typename C &gt; </td></tr>
<tr class="memitem:a583e4df1139cf6f20b6e79dfde977a51"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a583e4df1139cf6f20b6e79dfde977a51">for_each</a> (I first, I last, C &amp;&amp;callable)</td></tr>
<tr class="memdesc:a583e4df1139cf6f20b6e79dfde977a51"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a kernel that applies a callable to each dereferenced element of the data array  <a href="#a583e4df1139cf6f20b6e79dfde977a51">More...</a><br /></td></tr>
<tr class="separator:a583e4df1139cf6f20b6e79dfde977a51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0320596ee37d68cfce5746027ebc97de"><td class="memTemplParams" colspan="2">template&lt;typename I , typename C &gt; </td></tr>
<tr class="memitem:a0320596ee37d68cfce5746027ebc97de"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a0320596ee37d68cfce5746027ebc97de">for_each_index</a> (I first, I last, I step, C &amp;&amp;callable)</td></tr>
<tr class="memdesc:a0320596ee37d68cfce5746027ebc97de"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a kernel that applies a callable to each index in the range with the step size  <a href="#a0320596ee37d68cfce5746027ebc97de">More...</a><br /></td></tr>
<tr class="separator:a0320596ee37d68cfce5746027ebc97de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44fb0c626c46de1bb95369e33194f5c7"><td class="memTemplParams" colspan="2">template&lt;typename I , typename C , typename... S&gt; </td></tr>
<tr class="memitem:a44fb0c626c46de1bb95369e33194f5c7"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html#a44fb0c626c46de1bb95369e33194f5c7">transform</a> (I first, I last, C &amp;&amp;callable, S... srcs)</td></tr>
<tr class="memdesc:a44fb0c626c46de1bb95369e33194f5c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">captures a kernel that applies a callable to a source range and stores the result in a target range  <a href="#a44fb0c626c46de1bb95369e33194f5c7">More...</a><br /></td></tr>
<tr class="separator:a44fb0c626c46de1bb95369e33194f5c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a672b45d300c57d726c203c62f950efbd"><td class="memItemLeft" align="right" valign="top"><a id="a672b45d300c57d726c203c62f950efbd"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>cudaFlowCapturer</b></td></tr>
<tr class="separator:a672b45d300c57d726c203c62f950efbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>base class to construct a CUDA task graph through stream capture </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a9fd8983c782f841bba6b10de39becdf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fd8983c782f841bba6b10de39becdf6">&#9670;&nbsp;</a></span>copy()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , std::enable_if_t&lt;!std::is_same_v&lt; T, void &gt;, void &gt; * &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::copy </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>tgt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>num</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a copy task of typed data </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">T</td><td>element type (non-void)</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tgt</td><td>pointer to the target memory block </td></tr>
    <tr><td class="paramname">src</td><td>pointer to the source memory block </td></tr>
    <tr><td class="paramname">num</td><td>number of elements to copy</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classtf_1_1cudaTask.html" title="handle to a node of the internal CUDA graph ">cudaTask</a> handle</dd></dl>
<p>A copy task transfers <code>num*sizeof(T)</code> bytes of data from a source location to a target location. Direction can be arbitrary among CPUs and GPUs. </p>

</div>
</div>
<a id="a583e4df1139cf6f20b6e79dfde977a51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a583e4df1139cf6f20b6e79dfde977a51">&#9670;&nbsp;</a></span>for_each()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename I , typename C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::for_each </td>
          <td>(</td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">C &amp;&amp;&#160;</td>
          <td class="paramname"><em>callable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a kernel that applies a callable to each dereferenced element of the data array </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">I</td><td>iterator type </td></tr>
    <tr><td class="paramname">C</td><td>callable type</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first</td><td>iterator to the beginning (inclusive) </td></tr>
    <tr><td class="paramname">last</td><td>iterator to the end (exclusive) </td></tr>
    <tr><td class="paramname">callable</td><td>a callable object to apply to the dereferenced iterator</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classtf_1_1cudaTask.html" title="handle to a node of the internal CUDA graph ">cudaTask</a> handle</dd></dl>
<p>This method is equivalent to the parallel execution of the following loop on a GPU:</p>
<div class="fragment"><div class="line"><span class="keywordflow">for</span>(<span class="keyword">auto</span> itr = first; itr != last; i++) {</div><div class="line">  callable(*itr);</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a id="a0320596ee37d68cfce5746027ebc97de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0320596ee37d68cfce5746027ebc97de">&#9670;&nbsp;</a></span>for_each_index()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename I , typename C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::for_each_index </td>
          <td>(</td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>step</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">C &amp;&amp;&#160;</td>
          <td class="paramname"><em>callable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a kernel that applies a callable to each index in the range with the step size </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">I</td><td>index type </td></tr>
    <tr><td class="paramname">C</td><td>callable type</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first</td><td>beginning index </td></tr>
    <tr><td class="paramname">last</td><td>last index </td></tr>
    <tr><td class="paramname">step</td><td>step size </td></tr>
    <tr><td class="paramname">callable</td><td>the callable to apply to each element in the data array</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classtf_1_1cudaTask.html" title="handle to a node of the internal CUDA graph ">cudaTask</a> handle</dd></dl>
<p>This method is equivalent to the parallel execution of the following loop on a GPU:</p>
<div class="fragment"><div class="line"><span class="comment">// step is positive [first, last)</span></div><div class="line"><span class="keywordflow">for</span>(<span class="keyword">auto</span> i=first; i&lt;last; i+=step) {</div><div class="line">  callable(i);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// step is negative [first, last)</span></div><div class="line"><span class="keywordflow">for</span>(<span class="keyword">auto</span> i=first; i&gt;last; i+=step) {</div><div class="line">  callable(i);</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a id="ad836d32cc2e9532ce57fe3ad6cc67d5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad836d32cc2e9532ce57fe3ad6cc67d5d">&#9670;&nbsp;</a></span>kernel()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename F , typename... ArgsT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::kernel </td>
          <td>(</td>
          <td class="paramtype">dim3&#160;</td>
          <td class="paramname"><em>g</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dim3&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">F &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ArgsT &amp;&amp;...&#160;</td>
          <td class="paramname"><em>args</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a kernel </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">F</td><td>kernel function type </td></tr>
    <tr><td class="paramname">ArgsT</td><td>kernel function parameters type</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">g</td><td>configured grid </td></tr>
    <tr><td class="paramname">b</td><td>configured block </td></tr>
    <tr><td class="paramname">s</td><td>configured shared memory </td></tr>
    <tr><td class="paramname">f</td><td>kernel function </td></tr>
    <tr><td class="paramname">args</td><td>arguments to forward to the kernel function by copy</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classtf_1_1cudaTask.html" title="handle to a node of the internal CUDA graph ">cudaTask</a> handle </dd></dl>

</div>
</div>
<a id="a38adf66dfcc0829708db653d153a83e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38adf66dfcc0829708db653d153a83e2">&#9670;&nbsp;</a></span>memcpy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::memcpy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>copies data between host and device asynchronously through a stream </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dst</td><td>destination memory address </td></tr>
    <tr><td class="paramname">src</td><td>source memory address </td></tr>
    <tr><td class="paramname">count</td><td>size in bytes to copy</td></tr>
  </table>
  </dd>
</dl>
<p>The method captures a <code>cudaMemcpyAsync</code> operation through an internal stream. </p>

</div>
</div>
<a id="a8e3071171c0875c93dcc077a2e0a435a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e3071171c0875c93dcc077a2e0a435a">&#9670;&nbsp;</a></span>memset()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::memset </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>devPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>initializes or sets GPU memory to the given value byte by byte </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">devPtr</td><td>pointer to GPU mempry </td></tr>
    <tr><td class="paramname">value</td><td>value to set for each byte of the specified memory </td></tr>
    <tr><td class="paramname">count</td><td>size in bytes to set</td></tr>
  </table>
  </dd>
</dl>
<p>The method captures a <code>cudaMemsetAsync</code> operation through an internal stream to fill the first <code>count</code> bytes of the memory area pointed to by <code>devPtr</code> with the constant byte value <code>value</code>. </p>

</div>
</div>
<a id="adf651356def71f613c589c29588398c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf651356def71f613c589c29588398c2">&#9670;&nbsp;</a></span>on()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::on </td>
          <td>(</td>
          <td class="paramtype">C &amp;&amp;&#160;</td>
          <td class="paramname"><em>callable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a sequential CUDA operations from the given callable </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">C</td><td>callable type constructible with <code>std::function&lt;void(cudaStream_t)&gt;</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callable</td><td>a callable to capture CUDA operations with the stream</td></tr>
  </table>
  </dd>
</dl>
<p>This methods applies a stream created by the flow to capture a sequence of CUDA operations defined in the callable. </p>

</div>
</div>
<a id="ac25236625772a0a2c66831517b9ec288"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac25236625772a0a2c66831517b9ec288">&#9670;&nbsp;</a></span>single_task()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::single_task </td>
          <td>(</td>
          <td class="paramtype">C &amp;&amp;&#160;</td>
          <td class="paramname"><em>callable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>capturers a kernel to runs the given callable with only one thread </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">C</td><td>callable type</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callable</td><td>callable to run by a single kernel thread </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a44fb0c626c46de1bb95369e33194f5c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44fb0c626c46de1bb95369e33194f5c7">&#9670;&nbsp;</a></span>transform()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename I , typename C , typename... S&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtf_1_1cudaTask.html">cudaTask</a> tf::cudaFlowCapturerBase::transform </td>
          <td>(</td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">I&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">C &amp;&amp;&#160;</td>
          <td class="paramname"><em>callable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">S...&#160;</td>
          <td class="paramname"><em>srcs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>captures a kernel that applies a callable to a source range and stores the result in a target range </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">I</td><td>iterator type </td></tr>
    <tr><td class="paramname">C</td><td>callable type </td></tr>
    <tr><td class="paramname">S</td><td>source types</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first</td><td>iterator to the beginning (inclusive) </td></tr>
    <tr><td class="paramname">last</td><td>iterator to the end (exclusive) </td></tr>
    <tr><td class="paramname">callable</td><td>the callable to apply to each element in the range </td></tr>
    <tr><td class="paramname">srcs</td><td>iterators to the source ranges</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classtf_1_1cudaTask.html" title="handle to a node of the internal CUDA graph ">cudaTask</a> handle</dd></dl>
<p>This method is equivalent to the parallel execution of the following loop on a GPU:</p>
<div class="fragment"><div class="line"><span class="keywordflow">while</span> (first != last) {</div><div class="line">  *first++ = callable(*src1++, *src2++, *src3++, ...);</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="cuda__capturer_8hpp_source.html">cuda_capturer.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>tf</b></li><li class="navelem"><a class="el" href="classtf_1_1cudaFlowCapturerBase.html">cudaFlowCapturerBase</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
